﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" x:Class="CSharp2.Capitulo08.Threads.CotacoesWindow"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        Title="Cotações" Height="350" Width="525" Loaded="Window_Loaded">
    <Grid>
        <DataGrid x:Name="cotacaoDataGrid" ItemsSource="{Binding Cotacoes}" AutoGenerateColumns="False" IsReadOnly="True" 
                  VerticalAlignment="Top">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Empresa" Binding="{Binding NomeEmpresa}" MinWidth="200">
                    <!--<DataGridTextColumn.CellStyle>
                        <Style TargetType="DataGridCell">
                            <Setter Property="BorderBrush" Value="Red"></Setter>
                        </Style>
                    </DataGridTextColumn.CellStyle>-->
                </DataGridTextColumn>
                <DataGridTextColumn Header="Sigla" Binding="{Binding Sigla}" MinWidth="100"/>
                <DataGridTextColumn Header="Valor" Binding="{Binding Valor, StringFormat=\{0:n2\}}" MinWidth="150"/>
            </DataGrid.Columns>
        </DataGrid>
        <StatusBar VerticalAlignment="Bottom" Height="25">
            <StatusBarItem HorizontalAlignment="Right">
                <ProgressBar x:Name="cotacoesProgressBar" Height="17" Width="100" ValueChanged="cotacoesProgressBar_ValueChanged" >
                    <ProgressBar.Style>
                        <Style TargetType="{x:Type ProgressBar}">
                            <Setter Property="Foreground" Value="DarkGreen"/>
                            <Setter Property="Background" Value="DarkGray"/>
                        </Style>
                    </ProgressBar.Style>
                </ProgressBar>
            </StatusBarItem>
        </StatusBar>
        <xctk:BusyIndicator x:Name="cotacaoesBusyIndicator" BusyContent="Aguarde..." HorizontalAlignment="Center" VerticalAlignment="Center" IsBusy="True"/>
    </Grid>
</Window>